package com.aruba.rtmppushapplication.push.params;

/**
 * 音频参数
 * Created by aruba on 2021/1/12.
 */
public class AudioParams {
    //采样率
    private int sampleRate;
    //声道数
    private int channel;

    private AudioParams() {
    }

    public int getSampleRate() {
        return sampleRate;
    }

    public void setSampleRate(int sampleRate) {
        this.sampleRate = sampleRate;
    }

    public int getChannel() {
        return channel;
    }

    public void setChannel(int channel) {
        this.channel = channel;
    }

    public static class Builder {
        //采样率
        private int sampleRate = 44100;
        //声道数
        private int channel = 1;

        public Builder sampleRate(int sampleRate) {
            this.sampleRate = sampleRate;
            return this;
        }

        public Builder channel(int channel) {
            this.channel = channel;
            return this;
        }
        
        public AudioParams build(){
            AudioParams audioParams = new AudioParams();
            audioParams.setSampleRate(sampleRate);
            audioParams.setChannel(channel);
            
            return audioParams;
        }
    }
}
